﻿using System.Collections.ObjectModel;
using System.Configuration;
using E4D.AppFabric.Entities;

namespace MDCAdminTool
{
    public class Clusters : ObservableCollection<CacheCluster>
    {
        public string DistributedCacheConfigFile { get; set; }
        public ILogger Logger { get; set; }

        public Clusters()
        {
            
        }

        public void UseLocalCacheCluster()
        {
            var cluster = new CacheCluster();
            try
            {
                //var DistributedCacheConfigFile = Settings.Default.DistributedCacheConfigFile;
                cluster.Output = Logger;
                cluster.InitCacheCluster( DistributedCacheConfigFile );
                
            }
            finally
            {
                Add( cluster );
            }
        }
    }
}
